import Layout from '@/layout'
import ParentView from '@/components/ParentView'
const reportRouter = {
  path: '/table',
  component: Layout,
  redirect: '/table/data',
  name: 'TableStatic',
  alwaysShow: true,
  meta: {
    type: 'I',
    roles: ['5010', '5020', '5030', '5036', '5040', '5050', '5060'],
    title: '报表统计',
    icon: 'table'
  },
  children: [{
    path: 'purchase',
    component: ParentView,
    name: 'PurchaseStatic',
    alwaysShow: true,
    meta: {
      type: 'I',
      roles: ['5010'],
      title: '采购'
    },
    children: [{
      path: 'data',
      component: resolve => require(['@/views/table/purchase/data'], resolve),
      name: 'TablePurchase',
      meta: {
        type: 'I',
        roles: ['501010'],
        title: '采购统计'
      }
    }, {
      path: 'return',
      component: resolve => require(['@/views/table/purchase/return'], resolve),
      name: 'TablePurchasereturn',
      meta: {
        type: 'I',
        roles: ['501020'],
        title: '采购退货统计'
      }
    }]
  }, {
    path: 'sale',
    component: ParentView,
    name: 'TaleStatic',
    alwaysShow: true,
    meta: {
      type: 'I',
      roles: ['5020'],
      title: '销售'
    },
    children: [{
      path: 'data',
      component: resolve => require(['@/views/table/sale/data'], resolve),
      name: 'TableSale',
      meta: {
        type: 'I',
        roles: ['502010'],
        title: '销售统计'
      }
    }, {
      path: 'return',
      component: resolve => require(['@/views/table/sale/return'], resolve),
      name: 'TableSalereturn',
      meta: {
        type: 'I',
        roles: ['502020'],
        title: '销售退货统计'
      }
    }]
  }, {
    path: 'store',
    component: ParentView,
    name: 'TableStore',
    alwaysShow: true,
    meta: {
      type: 'I',
      roles: ['5030'],
      title: '库存'
    },
    children: [{
      path: 'warehousing',
      component: resolve => require(['@/views/table/store/warehousing'], resolve),
      name: 'TableWarehousing',
      meta: {
        type: 'I',
        roles: ['503010'],
        title: '入库统计'
      }
    }, {
      path: 'outbound',
      component: resolve => require(['@/views/table/store/outbound'], resolve),
      name: 'TableOutbound1',
      meta: {
        type: 'I',
        roles: ['503020'],
        title: '出库统计'
      }
    }, {
      path: 'allocation',
      component: resolve => require(['@/views/table/store/allocation'], resolve),
      name: 'TableAllocation',
      meta: {
        type: 'I',
        roles: ['503030'],
        title: '调拨统计'
      }
    }, {
      path: 'movement',
      component: resolve => require(['@/views/table/store/movement'], resolve),
      name: 'TableMovement',
      meta: {
        type: 'I',
        roles: ['503040'],
        title: '移库统计'
      }
    }, {
      path: 'outboundreturn',
      component: resolve => require(['@/views/table/store/outboundOrderReturned'], resolve),
      name: 'TableOutbound2',
      meta: {
        type: 'I',
        roles: ['503050'],
        title: '销售退货入库'
      }
    }, {
      path: 'inventory',
      component: resolve => require(['@/views/table/store/inventory'], resolve),
      name: 'TableInventory',
      meta: {
        type: 'I',
        roles: ['503070'],
        title: '盘点统计'
      }
    }, {
      path: 'warehouse',
      component: resolve => require(['@/views/table/store/warehouse'], resolve),
      name: 'TableWarehouse',
      meta: {
        type: 'I',
        roles: ['503080'],
        title: '仓库统计'
      }
    }, {
      path: 'truck',
      component: resolve => require(['@/views/table/store/truck'], resolve),
      name: 'TableTruck',
      meta: {
        type: 'I',
        roles: ['503090'],
        title: '车辆统计'
      }
    }, {
      path: 'warehousingreturn',
      component: resolve => require(['@/views/table/store/warehousingReturned'], resolve),
      name: 'TableWarehousingReturn',
      meta: {
        type: 'I',
        roles: ['503060'],
        title: '采购退货出库'
      }
    }]
  }, {
    path: 'presale',
    component: ParentView,
    alwaysShow: true,
    name: 'TablePresale',
    meta: {
      type: 'I',
      roles: ['5036'],
      title: '预收'
    },
    children: [{
      path: 'data',
      component: resolve => require(['@/views/table/presale/data'], resolve),
      name: 'TablePresale',
      meta: {
        type: 'I',
        roles: ['503610'],
        title: '预收款'
      }
    }, {
      path: 'return',
      component: resolve => require(['@/views/table/presale/return'], resolve),
      name: 'TablePresaleReturned',
      meta: {
        type: 'I',
        roles: ['503620'],
        title: '预收款退款'
      }
    }]
  }, {
    path: 'rpt',
    component: ParentView,
    alwaysShow: true,
    name: 'Tpt1',
    meta: {
      type: 'I',
      roles: ['5040'],
      title: '往来'
    },
    children: [{
      path: 'rpt1',
      component: resolve => require(['@/views/table/rp/receipt'], resolve),
      name: 'TableReceipt',
      meta: {
        type: 'I',
        roles: ['504010'],
        title: '收款'
      }
    }, {
      path: 'rpt2',
      component: resolve => require(['@/views/table/rp/payment'], resolve),
      name: 'TablePayment',
      meta: {
        type: 'I',
        roles: ['504020'],
        title: '付款'
      }
    }]
  }, {
    path: '/grossprofit',
    component: ParentView,
    alwaysShow: true,
    redirect: '/grossprofit/group',
    name: 'Grossprofit',
    meta: {
      type: 'I',
      roles: ['5050'],
      title: '毛利'
    },
    children: [{
      path: 'grossprofit',
      component: resolve => require(['@/views/table/grossprofit/grossprofit8'], resolve),
      name: 'Grossprofit',
      meta: {
        type: 'I',
        roles: ['505010'],
        title: '综合统计'
      }
    }, {
      path: 'grossprofit3',
      component: resolve => require(['@/views/table/grossprofit/grossprofit3'], resolve),
      name: 'Grossprofit3',
      meta: {
        type: 'I',
        roles: ['505020'],
        title: '周期辅助项统计'
      }
    }, {
      path: 'grossprofit4',
      component: resolve => require(['@/views/table/grossprofit/grossprofit4'], resolve),
      name: 'Grossprofit4',
      meta: {
        type: 'I',
        roles: ['505030'],
        title: '辅助项二维统计'
      }
    }, {
      path: 'grossprofit6',
      component: resolve => require(['@/views/table/grossprofit/grossprofit6'], resolve),
      name: 'Grossprofit6',
      meta: {
        type: 'I',
        roles: ['505040'],
        title: '品类分项统计'
      }
    }]
  }, {
    path: 'visit',
    component: resolve => require(['@/views/table/visit/data'], resolve),
    name: 'TableVisit',
    meta: {
      type: 'I',
      roles: ['5060'],
      title: '拜访'
    }
  }, {
    path: 'everydayTotal',
    component: resolve => require(['@/views/table/everyday/data'], resolve),
    name: 'EverydayTotal',
    meta: {
      type: 'I',
      roles: ['5060'],
      title: '日结'
    }
  }]
}

export default reportRouter
